package selection;

public class Selection {
    public static void sort(int[] nums){
        for (int end = nums.length - 1; end > 0; end--) {
            int maxIndex = 0;
            for(int start = 1; start <= end ;start++){
                if(nums[start] >= nums[maxIndex]){
                    maxIndex = start;
                }
            }
            int temp = nums[maxIndex];
            nums[maxIndex] = nums[end];
            nums[end] = temp;
        }
    }
}
